package edu.cmu.ece.ds.droidchat.message;

import java.io.Serializable;

/**
 * An object that represent the response to a login request from the DroidChat
 * server back to the DroidChat user
 *
 * a subclass of "DroidChatMessage"
 */
public class ClientLoginResponseMessage extends DroidChatMessage implements
		Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 7370351472324593787L;
	// possible response codes
	public static final int NO_USER = 1;
	public static final int WRONG_PASSWORD = 2;
	public static final int LOGIN_SUCCESSFUL = 3;

	private String username;
	private int response = 0; // the response code

	private int login_session_id = 0; // the login session id, valid only if
										// login
										// was successful

	private byte[] bytes = null; 
	private int bg = 0;
	private String nickname;

	public ClientLoginResponseMessage(String username, int reponse) {
		super(DroidChatMessage.CLIENT_LOGIN_RESPONSE);
		this.username = username;
		this.response = reponse;
	}

	// return the response code of this ClientLoginResponseMessage
	public int getResponse() {
		return response;
	}

	public String getUsername() {
		return username;
	}

	public int getLoginSessionID() {
		return login_session_id;
	}

	public void setLoginSessionID(int s) {
		this.login_session_id = s;
	}

	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}
	public byte[] getBytes(){
		return bytes;
	}
	public void setBG(int bg) {
		this.bg = bg;
	}
	public int getBG() {
		return this.bg;
	}
	
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
}
